//
//  AsyncTests.m
//  AsyncTests
//
//  Created by world on 13-6-5.
//  Copyright (c) 2013年 world. All rights reserved.
//

#import "AsyncTests.h"

@implementation AsyncTests

- (void)setUp
{
    [super setUp];
    
    // Set-up code here.
}

- (void)tearDown
{
    // Tear-down code here.
    
    [super tearDown];
}

- (void)testExample
{
   AsyncTask* task = [Async asyncTask:^NSString*(){
        NSString* str = [[NSString alloc] initWithFormat:@"%@ ", @"XXXXXXX"];
       return str;
    }
        withCallBack:@selector(loveCallBack:) onTarget:self];
       // STFail(@"Unit tests are not implemented yet in AsyncTests");
    
    [task context];
    
    NSRunLoop *loop = [NSRunLoop mainRunLoop];
    [loop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:20]];
}

-(void) loveCallBack:(NSString*)result{

    NSLog(@"callback result %@ ", result);
}

@end
